﻿using Microsoft.SharePoint;

namespace TSB.FarmPowerShellWizard.Repository
{
    public class Settings
    {
        public static bool IgnoreManagedProperty(string mp)
        {
            var ignored = Settings.GetPropertyBag("PowerShellWizard_IgnoreManagedProperties");

            return ignored.Contains(string.Format("|{0}|", mp));
        }

        public static string GetPropertyBag(string key)
        {
            if (SPContext.Current.Site.RootWeb.Properties.ContainsKey(key))
            {
                return SPContext.Current.Site.RootWeb.Properties[key].ToString();
            }

            return string.Empty;
        }
    }
}
